/*
 *
 * Copyright (C) 2012 Walter Lütgenau
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */
package offset.nodes.client.chooser.model;

import java.util.Collection;
import offset.nodes.client.model.ServerResponse;
import offset.nodes.client.model.UserRequest;

/**
 *
 * @author Walter Luetgenau
 */
public class FindNodes {
    public static final String FILTER_ANY = "*";
    
    public static class Request extends UserRequest {
        private String root; // the root node of the xpath
        private String filter = ""; // the xpath filter used to filter the subnodes
        private boolean includePathNodes = false;
        
        public String getFilter() {
            return filter;
        }
        
        public void setFilter(String filter) {
            this.filter = filter;
        }

        public String getRoot() {
            return root;
        }

        public void setRoot(String root) {
            this.root = root;
        }

        public boolean isIncludePathNodes() {
            return includePathNodes;
        }

        public void setIncludePathNodes(boolean includePathNodes) {
            this.includePathNodes = includePathNodes;
        }
    }
    
    public static class Response extends ServerResponse {
        
        private Collection<FolderNode> resultNodes; // the result nodes;
        
        public Response() {
            this(ServerResponse.RESULT_SUCCESS);
        }

        public Response(int result) {
            super(result);
        }
        
        public Collection<FolderNode> getResultNodes() {
            return resultNodes;
        }
        
        public void setResultNodes(Collection<FolderNode> resultNodes) {
            this.resultNodes = resultNodes;
        }
    }

}
